<template>
  <view>
    <button @tap="openMap">打开地图</button>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        
      }
    },
    methods: {
      openMap() {
       uni.chooseLocation({
       	success: function (res) {
       		console.log('位置名称：' + res.name);
       		console.log('详细地址：' + res.address);
       		console.log('纬度：' + res.latitude);
       		console.log('经度：' + res.longitude);
       	},
        fail:function(err){
          console.log(err)
        }
       });

      }
    }
  }
</script>

<style>

</style>
